package com.myway.service.impl;

import com.myway.dao.CharterFlightMapper;
import com.myway.dto.common.JsonData;
import com.myway.pojo.CharterFlight;
import com.myway.service.CharterFlightService;
import com.myway.sms.msmUtil.SendEmail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by wsq on 2018/8/27.
 */
@Service
public class CharterFlightServiceImpl implements CharterFlightService {

    @Autowired
    private CharterFlightMapper charterFlightMapper;

    @Override
    public JsonData addCharterFlight(CharterFlight charterFlight) {
        charterFlightMapper.insert(charterFlight);
        SendEmail sendEmail = new SendEmail();
        sendEmail.sendCharterMail(charterFlight.getEmail(), charterFlight);
        return JsonData.success();
    }

    @Override
    public JsonData cargoService(CharterFlight charterFlight) {
        SendEmail sendEmail = new SendEmail();
        sendEmail.sendCharterMail(charterFlight.getEmail(), charterFlight);
        return JsonData.success();
    }
}
